From: Sebastian Keller Date: Wed, 28 Apr 2021 05:15:03 +0000 (+0200) Subject: screenshot: Ignore events in SelectArea after making a selection X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~616^2^2~43 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=380d61dc431376833546380c8089ff4bdcdd3fce;p=gnome-shell.git screenshot: Ignore events in SelectArea after making a selection The grab and actor are only removed after the selection rectangle has finished fading out. During this time it was possible to still change the position of the selection rectangle. Related: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2761 Part-of: --- diff --git a/js/ui/screenshot.js b/js/ui/screenshot.js index e736c3f6c..81ab516b1 100644 --- a/js/ui/screenshot.js +++ b/js/ui/screenshot.js @@ -384,6 +384,9 @@ class SelectArea extends St.Widget { } vfunc_button_press_event(buttonEvent) { + if (this._result) + return Clutter.EVENT_PROPAGATE; + [this._startX, this._startY] = [buttonEvent.x, buttonEvent.y]; this._startX = Math.floor(this._startX); this._startY = Math.floor(this._startY); @@ -393,7 +396,7 @@ class SelectArea extends St.Widget { } vfunc_button_release_event() { - if (this._startX === -1 || this._startY === -1) + if (this._startX === -1 || this._startY === -1 || this._result) return Clutter.EVENT_PROPAGATE; this._result = this._getGeometry();